package com.yizhubao.app.activitys;

import android.os.Bundle;
import android.view.View;

import com.yizhubao.app.MainActivity;
import com.yizhubao.app.R;
import com.yizhubao.app.base.BaseActivityToolBar;

import butterknife.OnClick;

/**
 * 创建人: PACY
 * 创建时间: 6/4/21 10:25 AM
 * 邮箱: pengwwe457621023@qq.com
 * 类描述: 支付页面
 */
public class PaySuccessActivity extends BaseActivityToolBar {
    private int jumpType=3;//来源 1 保存内容页来的跳转到首页 2首页卡片跳转到详情页 3 个人中心来跳转到个人中心

    private String recordId;
    @Override
    protected int setContentLayout() {
        return R.layout.activity_pay_success;
    }

    @Override
    protected void initView() {
        setTitleOnLeftIcon(R.drawable.icon_back,"");
        jumpType=getIntent().getExtras().getInt("type");
        if(jumpType==2){
            //获取记录id
            recordId=getIntent().getExtras().getString("recordId");
        }
    }

    @Override
    protected void initData() {

    }

    @OnClick(value = {R.id.submit_tv})
    public void click(View v){
        if(v.getId()==R.id.submit_tv){
            switch (jumpType){
                case 1:
                    startActivity(PaySuccessActivity.this, MainActivity.class);
                    break;
                case 2:
                    Bundle bundle=new Bundle();
                    bundle.putString("recordId",recordId);
                    startActivity(PaySuccessActivity.this,RecordDetailActivity.class,bundle);
                    finish();
                    break;
                default:
                    finish();
                    break;
            }

        }
    }
}